<html>
<head><meta charset="utf-8"><title>Collaboration with functional package managers · general · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/index.html">general</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html">Collaboration with functional package managers</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225833525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225833525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Soo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225833525">(Feb 10 2021 at 13:15)</a>:</h4>
<p>Hello there, I work on guix and nix. I have been thinking for some time that functional package managers and rust ought to collaborate. Rustc and cargo have similar goals: reproducible builds, integration with existing systems and more. There have been some previous discussions about how to get cargo and rustc working more smoothly in nix and guix (around reusing rlibs, for instance). I am hoping to start a more formal collaboration. I am also willing to put in some work to accomplish it. Where would we start?</p>



<a name="225835654"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225835654" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225835654">(Feb 10 2021 at 13:33)</a>:</h4>
<p>Probably a list of issues that need to be solved would help. I had good success with crate2nix and nix in terms of achieving reproducibility and debugging instances where crates introduce non-reproducibility via <a href="http://build.rs">build.rs</a> scripts, so I'm curious what the problems are right now that need solving.</p>



<a name="225840353"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225840353" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Soo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225840353">(Feb 10 2021 at 14:09)</a>:</h4>
<p>I am thinking something longer term and more amenable to the functional package management paradigm. Shared rlibs that can be used as system libraries would be a huge step</p>



<a name="225840676"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225840676" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Soo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225840676">(Feb 10 2021 at 14:11)</a>:</h4>
<p>Another big win would be using file hashes instead of mtime to determine file changes</p>



<a name="225841883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225841883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225841883">(Feb 10 2021 at 14:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="316408">John Soo</span> <a href="#narrow/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers/near/225840353">said</a>:</p>
<blockquote>
<p>I am thinking something longer term and more amenable to the functional package management paradigm. Shared rlibs that can be used as system libraries would be a huge step</p>
</blockquote>
<p>that requires a stable ABI</p>



<a name="225841909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225841909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225841909">(Feb 10 2021 at 14:19)</a>:</h4>
<p><span class="user-mention silent" data-user-id="316408">John Soo</span> <a href="#narrow/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers/near/225840676">said</a>:</p>
<blockquote>
<p>Another big win would be using file hashes instead of mtime to determine file changes</p>
</blockquote>
<p>big +1 to this, though</p>



<a name="225842148"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225842148" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jonas Schievink  [he/him] <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225842148">(Feb 10 2021 at 14:20)</a>:</h4>
<p><span class="user-mention silent" data-user-id="232545">Joshua Nelson</span> <a href="#narrow/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers/near/225841883">said</a>:</p>
<blockquote>
<p>that requires a stable ABI</p>
</blockquote>
<p>Not if the rlibs are keyed by the rustc version used to build them</p>



<a name="225842545"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225842545" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225842545">(Feb 10 2021 at 14:23)</a>:</h4>
<p>ah yeah fair enough, if you only need them to be shared for a single toolchain it should work</p>



<a name="225842592"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225842592" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225842592">(Feb 10 2021 at 14:23)</a>:</h4>
<p>hmm, I would expect shared rlibs to work today then</p>



<a name="225845309"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225845309" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Soo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225845309">(Feb 10 2021 at 14:40)</a>:</h4>
<p>Oh that would be cool! Functional package managers already guarantee a fixed toolchain so that could be no problem</p>



<a name="225845424"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225845424" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Soo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225845424">(Feb 10 2021 at 14:41)</a>:</h4>
<p>Toolchain management is one of the big gains I see for rustaceans.</p>



<a name="225848379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225848379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225848379">(Feb 10 2021 at 15:01)</a>:</h4>
<p>rustc already encodes the version of the compiler in the meetadata and will refuse to use libraries compiled with other versions.</p>



<a name="225848525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225848525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225848525">(Feb 10 2021 at 15:02)</a>:</h4>
<p>to me its not super clear what's meant by "shared" rlib here. If its just building an rlib and then using it as an <code>--extern</code> dep in another invocation of rustc, then that's not exactly "shared" per se, its just the regular rust compilation model, using what are more resembling of static libraries.</p>



<a name="225860614"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225860614" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Soo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225860614">(Feb 10 2021 at 16:11)</a>:</h4>
<p>Hm. Could those rlibs be installed in a well defined system location and reused in different projects?</p>



<a name="225860791"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225860791" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> John Soo <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225860791">(Feb 10 2021 at 16:12)</a>:</h4>
<p>Is that what $RUST_HOME already does?</p>



<a name="225871850"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225871850" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> bjorn3 <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225871850">(Feb 10 2021 at 17:03)</a>:</h4>
<p>Cargo doesn't have any support for globally installed rlibs. Rustc does have a sysroot containing for example libstd, but the directory layout is unstable. $RUST_HOME is for the source caches and the default executable installation dir of cargo.</p>



<a name="225871962"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225871962" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225871962">(Feb 10 2021 at 17:03)</a>:</h4>
<p>there's the sysroot.</p>



<a name="225946068"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/122651-general/topic/Collaboration%20with%20functional%20package%20managers/near/225946068" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/122651-general/topic/Collaboration.20with.20functional.20package.20managers.html#225946068">(Feb 11 2021 at 03:56)</a>:</h4>
<p>Is <a href="https://github.com/mozilla/sccache"><code>sccache</code></a> relevant here? (I don't know much about it, but I thought it might be somewhat relevant.)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>